Optimal. Leaf size=144 \[ -\frac {\left (a^3 (-d)+3 a^2 b c+3 a b^2 d-b^3 c\right ) \log (\cos (e+f x))}{f \left (c^2+d^2\right )}+\frac {x \left (a^3 c+3 a^2 b d-3 a b^2 c-b^3 d\right )}{c^2+d^2}+\frac {b^2 (a+b \tan (e+f x))}{d f}-\frac {(b c-a d)^3 \log (c+d \tan (e+f x))}{d^2 f \left (c^2+d^2\right )} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.27, antiderivative size = 144, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 25, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {3566, 3626, 3617, 31, 3475} \[ -\frac {\left (3 a^2 b c+a^3 (-d)+3 a b^2 d-b^3 c\right ) \log (\cos (e+f x))}{f \left (c^2+d^2\right )}+\frac {x \left (3 a^2 b d+a^3 c-3 a b^2 c-b^3 d\right )}{c^2+d^2}+\frac {b^2 (a+b \tan (e+f x))}{d f}-\frac {(b c-a d)^3 \log (c+d \tan (e+f x))}{d^2 f \left (c^2+d^2\right )} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 31
Rule 3475
Rule 3566
Rule 3617
Rule 3626
Rubi steps
\begin {align*} \int \frac {(a+b \tan (e+f x))^3}{c+d \tan (e+f x)} \, dx &=\frac {b^2 (a+b \tan (e+f x))}{d f}+\frac {\int \frac {-b^3 c+a^3 d+b \left (3 a^2-b^2\right ) d \tan (e+f x)-b^2 (b c-3 a d) \tan ^2(e+f x)}{c+d \tan (e+f x)} \, dx}{d}\\ &=\frac {\left (a^3 c-3 a b^2 c+3 a^2 b d-b^3 d\right ) x}{c^2+d^2}+\frac {b^2 (a+b \tan (e+f x))}{d f}-\frac {(b c-a d)^3 \int \frac {1+\tan ^2(e+f x)}{c+d \tan (e+f x)} \, dx}{d \left (c^2+d^2\right )}+\frac {\left (3 a^2 b c-b^3 c-a^3 d+3 a b^2 d\right ) \int \tan (e+f x) \, dx}{c^2+d^2}\\ &=\frac {\left (a^3 c-3 a b^2 c+3 a^2 b d-b^3 d\right ) x}{c^2+d^2}-\frac {\left (3 a^2 b c-b^3 c-a^3 d+3 a b^2 d\right ) \log (\cos (e+f x))}{\left (c^2+d^2\right ) f}+\frac {b^2 (a+b \tan (e+f x))}{d f}-\frac {(b c-a d)^3 \operatorname {Subst}\left (\int \frac {1}{c+x} \, dx,x,d \tan (e+f x)\right )}{d^2 \left (c^2+d^2\right ) f}\\ &=\frac {\left (a^3 c-3 a b^2 c+3 a^2 b d-b^3 d\right ) x}{c^2+d^2}-\frac {\left (3 a^2 b c-b^3 c-a^3 d+3 a b^2 d\right ) \log (\cos (e+f x))}{\left (c^2+d^2\right ) f}-\frac {(b c-a d)^3 \log (c+d \tan (e+f x))}{d^2 \left (c^2+d^2\right ) f}+\frac {b^2 (a+b \tan (e+f x))}{d f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] time = 0.77, size = 126, normalized size = 0.88 \[ \frac {\frac {2 b^2 (a+b \tan (e+f x))}{d}+\frac {2 (a d-b c)^3 \log (c+d \tan (e+f x))}{d^2 \left (c^2+d^2\right )}+\frac {(a+i b)^3 \log (-\tan (e+f x)+i)}{-d+i c}-\frac {(b+i a)^3 \log (\tan (e+f x)+i)}{c-i d}}{2 f} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.62, size = 206, normalized size = 1.43 \[ \frac {2 \, {\left ({\left (a^{3} - 3 \, a b^{2}\right )} c d^{2} + {\left (3 \, a^{2} b - b^{3}\right )} d^{3}\right )} f x - {\left (b^{3} c^{3} - 3 \, a b^{2} c^{2} d + 3 \, a^{2} b c d^{2} - a^{3} d^{3}\right )} \log \left (\frac {d^{2} \tan \left (f x + e\right )^{2} + 2 \, c d \tan \left (f x + e\right ) + c^{2}}{\tan \left (f x + e\right )^{2} + 1}\right ) + {\left (b^{3} c^{3} - 3 \, a b^{2} c^{2} d + b^{3} c d^{2} - 3 \, a b^{2} d^{3}\right )} \log \left (\frac {1}{\tan \left (f x + e\right )^{2} + 1}\right ) + 2 \, {\left (b^{3} c^{2} d + b^{3} d^{3}\right )} \tan \left (f x + e\right )}{2 \, {\left (c^{2} d^{2} + d^{4}\right )} f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 1.83, size = 177, normalized size = 1.23 \[ \frac {\frac {2 \, b^{3} \tan \left (f x + e\right )}{d} + \frac {2 \, {\left (a^{3} c - 3 \, a b^{2} c + 3 \, a^{2} b d - b^{3} d\right )} {\left (f x + e\right )}}{c^{2} + d^{2}} + \frac {{\left (3 \, a^{2} b c - b^{3} c - a^{3} d + 3 \, a b^{2} d\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{c^{2} + d^{2}} - \frac {2 \, {\left (b^{3} c^{3} - 3 \, a b^{2} c^{2} d + 3 \, a^{2} b c d^{2} - a^{3} d^{3}\right )} \log \left ({\left | d \tan \left (f x + e\right ) + c \right |}\right )}{c^{2} d^{2} + d^{4}}}{2 \, f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.30, size = 364, normalized size = 2.53 \[ \frac {b^{3} \tan \left (f x +e \right )}{f d}+\frac {a^{3} d \ln \left (c +d \tan \left (f x +e \right )\right )}{f \left (c^{2}+d^{2}\right )}-\frac {3 \ln \left (c +d \tan \left (f x +e \right )\right ) a^{2} b c}{f \left (c^{2}+d^{2}\right )}+\frac {3 \ln \left (c +d \tan \left (f x +e \right )\right ) a \,b^{2} c^{2}}{f d \left (c^{2}+d^{2}\right )}-\frac {\ln \left (c +d \tan \left (f x +e \right )\right ) b^{3} c^{3}}{f \,d^{2} \left (c^{2}+d^{2}\right )}-\frac {a^{3} \ln \left (1+\tan ^{2}\left (f x +e \right )\right ) d}{2 f \left (c^{2}+d^{2}\right )}+\frac {3 \ln \left (1+\tan ^{2}\left (f x +e \right )\right ) a^{2} b c}{2 f \left (c^{2}+d^{2}\right )}+\frac {3 \ln \left (1+\tan ^{2}\left (f x +e \right )\right ) a \,b^{2} d}{2 f \left (c^{2}+d^{2}\right )}-\frac {\ln \left (1+\tan ^{2}\left (f x +e \right )\right ) c \,b^{3}}{2 f \left (c^{2}+d^{2}\right )}+\frac {a^{3} \arctan \left (\tan \left (f x +e \right )\right ) c}{f \left (c^{2}+d^{2}\right )}+\frac {3 \arctan \left (\tan \left (f x +e \right )\right ) a^{2} b d}{f \left (c^{2}+d^{2}\right )}-\frac {3 \arctan \left (\tan \left (f x +e \right )\right ) a \,b^{2} c}{f \left (c^{2}+d^{2}\right )}-\frac {\arctan \left (\tan \left (f x +e \right )\right ) b^{3} d}{f \left (c^{2}+d^{2}\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.84, size = 174, normalized size = 1.21 \[ \frac {\frac {2 \, b^{3} \tan \left (f x + e\right )}{d} + \frac {2 \, {\left ({\left (a^{3} - 3 \, a b^{2}\right )} c + {\left (3 \, a^{2} b - b^{3}\right )} d\right )} {\left (f x + e\right )}}{c^{2} + d^{2}} - \frac {2 \, {\left (b^{3} c^{3} - 3 \, a b^{2} c^{2} d + 3 \, a^{2} b c d^{2} - a^{3} d^{3}\right )} \log \left (d \tan \left (f x + e\right ) + c\right )}{c^{2} d^{2} + d^{4}} + \frac {{\left ({\left (3 \, a^{2} b - b^{3}\right )} c - {\left (a^{3} - 3 \, a b^{2}\right )} d\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{c^{2} + d^{2}}}{2 \, f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 5.49, size = 177, normalized size = 1.23 \[ \frac {b^3\,\mathrm {tan}\left (e+f\,x\right )}{d\,f}+\frac {\ln \left (c+d\,\mathrm {tan}\left (e+f\,x\right )\right )\,\left (a^3\,d^3-3\,a^2\,b\,c\,d^2+3\,a\,b^2\,c^2\,d-b^3\,c^3\right )}{f\,\left (c^2\,d^2+d^4\right )}+\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )-\mathrm {i}\right )\,\left (-a^3\,1{}\mathrm {i}+3\,a^2\,b+a\,b^2\,3{}\mathrm {i}-b^3\right )}{2\,f\,\left (c+d\,1{}\mathrm {i}\right )}+\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )\,\left (-a^3+a^2\,b\,3{}\mathrm {i}+3\,a\,b^2-b^3\,1{}\mathrm {i}\right )}{2\,f\,\left (d+c\,1{}\mathrm {i}\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 2.05, size = 1712, normalized size = 11.89 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________